The US markets ended higher on Thursday as a new quarter and the second half of the year began with upbeat economic data and a broad-based rally.